﻿using models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class ProductTypeService
    {
        // 商品类型
        public bool AddProductType(ProductType productType)
        {
            /// <summary>
            /// 商品类型
            /// </summary>
            string sql = string.Format("insert productType values('{0}','{1}')", productType.TypeName, productType.Typecount);
            return DBhelper.ex(sql);

        }
        // 查询商品类型
        public SqlDataReader GetProductType(int id)
        {
            string sql = string.Format("select top 2  *from ProductType where id='{0}'", id);
            return DBhelper.DataReader(sql);
        }
        // 查询商品类型
        public SqlDataReader GetProductType2()
        {
            string sql = string.Format("select *from ProductType ");
            return DBhelper.DataReader(sql);
        }
        //查询所有商品组合类型
        public SqlDataReader SumProductType()
        {
            string sql = string.Format("select*from ProductType");
            return DBhelper.DataReader(sql);
        }

    }
}
